#ifndef _LOG_H_
#define _LOG_H_
#include <string>
#include <vector>

#include "singleton.h"
using namespace edm::common;

#include "log_impl.h"

#define COMMON "COMMON"

#define ENABLE_LOG_FATAL
#define ENABLE_LOG_ERROR
#define ENABLE_LOG_WARN
#define ENABLE_LOG_INFO
#define ENABLE_LOG_TRACE
#define ENABLE_LOG_DEBUG

#ifdef ENABLE_LOG_FATAL
#define logfatal(x) singleton<Log>::Instance()._logfatal x
#else
#define logfatal(x) {}
#endif

#ifdef ENABLE_LOG_ERROR
#define logerror(x) singleton<Log>::Instance()._logerror x
#else
#define logerror(x) {}
#endif

#ifdef ENABLE_LOG_WARN
#define logwarn(x) singleton<Log>::Instance()._logwarn x
#else
#define logwarn(x) {}
#endif

#ifdef ENABLE_LOG_INFO
#define loginfo(x) singleton<Log>::Instance()._loginfo x
#else
#define loginfo(x) {}
#endif

#ifdef ENABLE_LOG_TRACE
#define logtrace(x) singleton<Log>::Instance()._logtrace x
#else
#define logtrace(x) {}
#endif

#ifdef ENABLE_LOG_DEBUG
#define logdebug(x) singleton<Log>::Instance()._logdebug x
#else
#define logdebug(x) {}
#endif


int init_log(const std::string& path,
						 const std::string& file,
						 const int	flag_print_file,
						 const int	flag_print_screen,
						 const int  flag_log_level,
						 const std::vector<std::string>& modules,
						 const int  max_line = 100000,
						 const int  maz_size = 5000000);

#endif //_LOG_H_
